package com.example.designpattenexample.combination;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class CurrentOrg implements Organization {

    private String name;
    private String code;
    private List<Organization> childOrgs = new ArrayList<>();

    public void addOrgs(Organization orgs){
        childOrgs.add(orgs);
    }

    CurrentOrg(String name,String code){
        this.name = name;
        this.code = code;
    }
    @Override
    public String printInfo() {
        return this.name + "-" + this.code;
    }
}
